/*
   创建三个对象并且进行选取打印
 */
public class TestWork05 {
    public static void main(String[] args) {
        Work05 book1 = new Work05(123, "水浒传", 50);
        Work05 book2 = new Work05(124, "三国演义", 52);
        Work05 book3 = new Work05();
        book3.setId(125);
        book3.setName("红楼梦");
        book3.setPrice(86);
        int maxPrice = book1.getPrice();
        if (maxPrice < book2.getPrice()) {
            maxPrice = book2.getPrice();
        }
        if (maxPrice < book3.getPrice()) {
            maxPrice = book3.getPrice();
        }
        if (maxPrice == book1.getPrice()) {
            book1.print();
        }
        if (maxPrice == book2.getPrice()) {
            book2.print();
        }
        if (maxPrice == book3.getPrice()) {
            book3.print();
        }
    }
}